package com.softplus.carrefour.hd.bltier.entity;


import java.io.Serializable;

import java.util.Date;
import java.util.HashMap;

import org.apache.commons.lang.builder.ToStringBuilder;


/** @author Hibernate CodeGenerator */
public class UserLevel implements Serializable {


    public static final String LEVEL_1_COUNTRY_HELPDESK = "L1C";
    public static final String LEVEL_2_COUNTRY_APPLICATION_TEAM_BACK_OFFICE = 
        "L2C";
    public static final String LEVEL_2_AMS_ZONE_ASIA = "L2Z";
    public static final String LEVEL_3_AMS_BANGKOK = "L3BKK";
    public static final String LEVEL_3_ZONE_DATA_CENTER = "L3ZDC";
    public static final String PRODUCTION_STAFF = "PROD";
    public static final String ADMIN = "ADM";
    public static final String ADMIN_COUNTRY = "ADMC";


    public static final HashMap uLevel = new HashMap();

    static {
        uLevel.put("L1C", "Level 1 Country Helpdesk");
        uLevel.put("L2C", "Level 2 Country Application Team Back Office");
        uLevel.put("L2Z", "Level 2 AMS Zone Asia");
        uLevel.put("L3BKK", "Level 3 Zone (Aldata)");
        //uLevel.put("L3BKK", "Level 3 AMS Bangkok");
        uLevel.put("PROD", "Level 3 Zone (Technical)");
        //uLevel.put("PROD", "Production Staff");
        uLevel.put("L3ZDC", "Level 3 Zone (Data Center)");
        uLevel.put("ADM", "Administrator");
        uLevel.put("ADMC", "Supervisor");
    }

    /** identifier field */
    private String userId;

    /** nullable persistent field */
    private String ulevel;

    /** nullable persistent field */
    private String credBy;

    /** nullable persistent field */
    private Date credDate;

    /** nullable persistent field */
    private String updBy;

    /** nullable persistent field */
    private Date updDate;

    /** nullable persistent field */
    private UserAccount userAccount;


    /** full constructor */
    public UserLevel(String userId, String ulevel, String credBy, 
                     Date credDate, String updBy, Date updDate) {
        this.userId = userId;
        this.ulevel = ulevel;
        this.credBy = credBy;
        this.credDate = credDate;
        this.updBy = updBy;
        this.updDate = updDate;

    }

    /** default constructor */
    public UserLevel() {
    }

    /** minimal constructor */
    public UserLevel(String userId) {
        this.userId = userId;
    }

    public UserAccount getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(UserAccount userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserId() {
        return this.userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUlevel() {
        return this.ulevel;
    }

    public void setUlevel(String ulevel) {
        this.ulevel = ulevel;
    }

    public String getCredBy() {
        return this.credBy;
    }

    public void setCredBy(String credBy) {
        this.credBy = credBy;
    }

    public Date getCredDate() {
        return this.credDate;
    }

    public void setCredDate(Date credDate) {
        this.credDate = credDate;
    }

    public String getUpdBy() {
        return this.updBy;
    }

    public void setUpdBy(String updBy) {
        this.updBy = updBy;
    }

    public Date getUpdDate() {
        return this.updDate;
    }

    public void setUpdDate(Date updDate) {
        this.updDate = updDate;
    }

    public String toString() {
        return new ToStringBuilder(this).append("userId", 
                                                getUserId()).toString();
    }

    public static String getLevelName(String level) {
        if (uLevel == null || uLevel.size() == 0) {

            //            uLevel.put("L1C", "Level 1 Country Helpdesk");
            //            uLevel.put("L2C", "Level 2 Country Application Team Back Office");
            //            uLevel.put("L2Z", "Level 2 AMS Zone Asia");
            //            uLevel.put("L3BKK", "Level 3 AMS Bangkok");
            //            uLevel.put("PROD", "Production Staff");
            //            uLevel.put("ADM", "Administrator");
            //            uLevel.put("ADMC", "Supervisor");
            //Should be as same as static declaration aboved.
            uLevel.put("L1C", "Level 1 Country Helpdesk");
            uLevel.put("L2C", "Level 2 Country Application Team Back Office");
            uLevel.put("L2Z", "Level 2 AMS Zone Asia");
            uLevel.put("L3BKK", "Level 3 Zone (Aldata)");
            //uLevel.put("L3BKK", "Level 3 AMS Bangkok");
            uLevel.put("PROD", "Level 3 Zone (Technical)");
            //uLevel.put("PROD", "Production Staff");
            uLevel.put("L3ZDC", "Level 3 Zone (Data Center)");
            uLevel.put("ADM", "Administrator");
            uLevel.put("ADMC", "Supervisor");
        }
        return (String)uLevel.get(level);
    }

}
